%% Abstract wrapper class
classdef GThing < handle

  properties
    gtype = uint32(0)       % glong
    value = uint64(0)       % gpointer
  end

  methods
    %% This is an internal constructor!
    function obj = GThing(gtype, value)
      if nargin == 2
        obj.gtype = gtype;
        obj.value = value;
      end
    end

    function s = char(obj)
      cls = class(obj);
%      if strcmp(cls(1:5), 'glib.'), cls = cls(6:length(cls)); end
      s = sprintf('%s(%s, %lx)', cls, glib.g_type_name(obj.gtype), uint64(obj.value));
    end
    
    function disp(obj)
      disp(char(obj));
    end

  end  % Public Methods

end  % Classdef
